<template>
  <div class="notifyWrapper">
    <!-- 提示图标 -->
    <i class="notifi iconfont icon-Vector"></i>
    <!-- 提示列表 -->
    <transition name="fade">
      <div class="notifyList">
        <div class="notifyItem" @click="toPersonDetail" :key="index" v-for="(item, index) in 10">
          <img
            width="40"
            height="40"
            class="userAvatar"
            :src="require('@/assets/images/320.png')"
            alt
            srcset
          />
          <div class="names">
            <p class="name">KenNaNa</p>
            <p class="address">{{ getAddress() }}</p>
          </div>
        </div>
      </div>
    </transition>
  </div>
</template>

<script lang="ts">
import { Component } from 'nuxt-property-decorator'
import { getOmittedAddress } from '@/utils/getOmittedAddress'
import { BaseVue } from '@/plugins/base-vue'
@Component({})
export default class NotifyList extends BaseVue {
  // 获取加密地址
  getAddress() {
    return getOmittedAddress('0xfe3439beF030C83f0E3d369F4CbED6061C177c5A')
  }

  // 跳转到详情
  toPersonDetail() {
    this.$router.push({ path: '/person/detail' })
  }
}
</script>

<style lang="scss" scoped>
.notifyWrapper {
  &:hover {
    .notifi {
      color: #fff;
      transition: color 0.5s;
    }
    .notifyList {
      display: block;
    }
  }
  .notifi {
    font-size: 45px;
    margin-right: 20px;

    &::after {
      position: absolute;
      z-index: 1000;
      content: '';
      width: 10px;
      height: 10px;
      background: red;
      border-radius: 50%;
      color: red;
      top: 28px;
      right: 91px;
    }
  }
  .notifyList {
    display: none;
    overflow-y: auto;
    &::-webkit-scrollbar {
      height: 0;
      width: 0;
      color: transparent;
    }
    height: 500px;
    padding: 10px;
    background: #1c1d21;
    box-shadow: 0 8px 10px -5px rgb(0 0 0 / 10%),
      0 16px 24px 2px rgb(0 0 0 / 14%), 0 6px 30px 5px rgb(0 0 0 / 12%);
    width: 200px;
    position: absolute;
    top: 68px;
    right: 0;
    .notifyItem {
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      padding: 10px;
      border-radius: 5px;
      background: #2f2f32;
      .userAvatar {
        border-radius: 50%;
      }
      &:hover {
        transition: all 0.5s;
        // box-shadow: 0 8px 10px -5px rgb(0 0 0 / 10%),
        //   0 16px 24px 2px rgb(0 0 0 / 14%), 0 6px 30px 5px rgb(0 0 0 / 12%);
        box-shadow: rgba(255, 255, 255, 0.25) 0px 54px 55px,
          rgba(255, 255, 255, 0.12) 0px -12px 30px,
          rgba(255, 255, 255, 0.12) 0px 4px 6px,
          rgba(255, 255, 255, 0.17) 0px 12px 13px,
          rgba(255, 255, 255, 0.09) 0px -3px 5px;
        .names {
          .name,
          .address {
            color: #fff;
          }
        }
      }
      .names {
        margin-left: 10px;
        .name {
          color: #9e9ea7;
        }
        .address {
          margin-top: 5px;
          color: #9e9ea7;
        }
      }
    }
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.1s;
}
.fade-enter,
.fade-leave-active {
  opacity: 0;
}
</style>